﻿using System.Linq.Expressions;

namespace Basic.ScheduledTask.Abstract
{
    public interface IJobManager
    {
        HashSet<string> LoadedJobIds { get; }

        void AddOnceJob(Expression<Action> expression);
        void AddOnceJob(Expression<Action> expression, DateTimeOffset time);
        void DelayJob(Expression<Action> expression, TimeSpan delayTime);
        string AddRecurringJob(string jobId, Expression<Action> expression, string cron);
        string AddRecurringJob<T>(string jobId, Expression<Action<T>> expression, string cron) where T : class;
        void RemoveJob(string jobId);

        void AddOnceJob(Expression<Func<Task>> expression);
        void AddOnceJob(Expression<Func<Task>> expression, DateTimeOffset time);
        void DelayJob(Expression<Func<Task>> expression, TimeSpan delayTime);

        string AddRecurringJob(string jobId, Expression<Func<Task>> expression, string cron);
        string AddRecurringJob<T>(string jobId, Func<T, Task> action, string cron) where T : class;



    }
}